/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package ru.jSkyRoom.bridge.major;

import ru.jSkyRoom.interfaces.major.Scroll;
import ru.jSkyRoom.interfaces.stub.EquipSlot;
import ru.jSkyRoom.interfaces.stub.StaticObject;
import ru.jSkyRoom.interfaces.sub.JSkyModel;
import skyproc.FormID;
import skyproc.MagicItem.SPELFlag;
import skyproc.Model;
import skyproc.SCRL;
import skyproc.SPEL;
import skyproc.genenums.CastType;
import skyproc.genenums.DeliveryType;

/**
 *
 * @author Rakev
 */
public class ScrollBridge extends MagicItemBridge<SCRL> implements Scroll {

    public ScrollBridge(SCRL adapting) {
        super(adapting);
    }

    @Override
    public StaticObject getMenuDisplayObject() {
        FormID id = getRawObject().getMenuDisplayObject();
        return getFinderFactory().createStaticObjectFinder().find(id);
    }

    @Override
    public void setMenuDisplayObject(StaticObject obj) {
        FormID id = getIdProducer().produce(obj);
        getRawObject().setMenuDisplayObject(id);
    }

    @Override
    public EquipSlot getEquipSlot() {
        FormID id = getRawObject().getEquipmentType();
        return getFinderFactory().createEquipSlotFinder().find(id);
    }

    @Override
    public void setEquipSlot(EquipSlot slot) {
        FormID id = getIdProducer().produce(slot);
        getRawObject().setEquipmentType(id);
    }

    @Override
    public JSkyModel getModel() {
        Model model = getRawObject().getModelData();
        return getBridgeFactory().createBridge(model);
    }

    @Override
    public int getValue() {
        return getRawObject().getValue();
    }

    @Override
    public void setValue(int value) {
        getRawObject().setValue(value);
    }

    @Override
    public float getWeight() {
        return getRawObject().getWeight();
    }

    @Override
    public void setWeight(float weight) {
        getRawObject().setWeight((float) weight);
    }

    @Override
    public int getBaseCost() {
        return getRawObject().getBaseCost();
    }

    @Override
    public void setBaseCost(int baseCost) {
        getRawObject().setBaseCost(baseCost);
    }

    @Override
    public boolean getFlag(SPELFlag flag) {
        return getRawObject().get(flag);
    }

    @Override
    public void setFlag(SPELFlag flag) {
        getRawObject().set(flag, true);
    }

    @Override
    public void unsetFlag(SPELFlag flag) {
        getRawObject().set(flag, false);
    }

    @Override
    public SPEL.SPELType getSpellType() {
        return getRawObject().getSpellType();
    }

    @Override
    public void setSpellType(SPEL.SPELType type) {
        getRawObject().setSpellType(type);
    }

    @Override
    public float getChargeTime() {
        return getRawObject().getChargeTime();
    }

    @Override
    public void setChargeTime(float chargeTime) {
        getRawObject().setChargeTime(chargeTime);
    }

    @Override
    public CastType getCastType() {
        return getRawObject().getCastType();
    }

    @Override
    public void setCastType(CastType type) {
        getRawObject().setCastType(type);
    }

    @Override
    public DeliveryType getDeliveryType() {
        return getRawObject().getDeliveryType();
    }

    @Override
    public void setDeliveryType(DeliveryType type) {
        getRawObject().setDeliveryType(type);
    }

    @Override
    public float getCastDuration() {
        return getRawObject().getCastDuration();
    }

    @Override
    public void setCastDuration(float duration) {
        getRawObject().setCastDuration(duration);
    }

    @Override
    public float getRange() {
        return getRawObject().getRange();
    }

    @Override
    public void setRange(float range) {
        getRawObject().setRange(range);
    }

}
